package edu.mobbuzz.web.components;

import org.apache.tapestry5.MarkupWriter;
import org.apache.tapestry5.annotations.InjectPage;
import org.apache.tapestry5.ioc.annotations.Inject;
import org.apache.tapestry5.services.RequestGlobals;
import org.apache.tapestry5.services.Session;

import edu.mobbuzz.web.base.SecureBasePage;
import edu.mobbuzz.web.pages.Index;

public class Profile extends SecureBasePage {
	@InjectPage
	private Index index;
	
	@Inject
	private RequestGlobals requestGlobals;
	
	Object onActionFromLogout() {
		
		Session session = requestGlobals.getRequest().getSession(false);
		if (null != session) {
			session.invalidate();
		}
		return index;
	}
	boolean beforeRender(MarkupWriter writer){
		 return true;
	} 
}
